package com.ghl.crawler;

import com.ghl.crawler.core.DBHelper;
import com.ghl.crawler.entity.Item;
import com.ghl.crawler.mapper.ItemMapper;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Description
 * @Author haiLong <1105744725@qq.com>
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2019/11/24 9:39
 */
public class TestMybatis {

    public static void main(String[] args) {


        SqlSession session = DBHelper.getSession();
        ItemMapper mapper = session.getMapper(ItemMapper.class);

//        List<Item> items = mapper.listQuery(null);
//
//        items.forEach(item -> System.out.println(item));
        Item item = new Item();
        item.setContent("wkflfnlkNFKLFnlksFNDMklsfndls;dfnml");
        item.setName("阿法尔范");
        mapper.insertItem(item);

        session.close();

    }
}
